<!-- 列表 -->
<extend name="Public:layout" />
<block name="title"><{$authName}></block>

<block name="pluginCSS">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Admin/plugins/select2/select2.css"/>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Admin/plugins/select2/select2-metronic.css"/>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Admin/plugins/bootstrap-fileinput/bootstrap-fileinput.css"/>
</block>
<block name="CSS"></block>

<block name="loadJS">
<script src="__PUBLIC__/Admin/plugins/bootstrap-fileinput/bootstrap-fileinput.js"></script>
<script type="text/javascript" src="__PUBLIC__/Admin/plugins/select2/select2.min.js"></script>
<script src="__PUBLIC__/admin/scripts/layer/layer.js" type="text/javascript"></script>	
<script type="text/javascript" src="__PUBLIC__/admin/plugins/ckeditor/ckeditor.js"></script>
<script src="__PUBLIC__/admin/plugins/jquery-validation/dist/jquery.validate.min.js" type="text/javascript"></script>
</block>
<block name="setJS">
<script src="__PUBLIC__/Admin/scripts/custom/validateArticles.js"></script>
<script>
var ajaxUrl="<{:U('index')}>";
var managerId="<{$Think.session.managerId}>";
function callback(message,status)  {  
	if(status==1)  {  
		layer.msg(message, 
			{icon: 1,time: 2000},
			function(){
				$('#responsive').modal('hide');
				$('#responsive form')[0].reset();
				oTable.fnReloadAjax();
			}
		);   
	}  else{  
		layer.msg(message, 
			{icon: 2,time: 2000}
		);   
		
	}  
}  
</script>
</block>
<block name="initJS">
ValidateArticles.init();
</block>

<block name="pagetitle">增删改查</block>
<block name="page">
<div class="row">
	<div class="col-md-12">

		<div class="portlet">
			<div class="portlet-title">
				<div class="caption">
					<i class="fa <{$authIco}>"></i><{$authName}>
				</div>
				
				<div class="actions">
					<a class="btn default green-stripe" id="table_manager_new" data-toggle="modal" href="javascript:history.back()">
						<i class="fa fa-reply"></i>
						<span class="hidden-480">返回</span>
					</a>
				</div>				
			</div>
			<div class="portlet-body">			
				<form class="form-horizontal" method="post" action="<{:U('index')}>">
					<input type='hidden' name='articleId' id='articleId' value='<{$articles.articleId}>'/>
					<input type='hidden' name='ajax' id='ajax' value='editArticles'/>
					<div class="form-group">
						<label class="col-sm-2 control-label" for="articleTitle">文章标题</label>
						<div class="col-md-6">
							<input type="text" class="form-control" placeholder="文章标题" name="articleTitle" id="articleTitle"  value="<{$articles.articleTitle}>" />
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label" for="catId">文章分类</label>
						
						<div class="col-md-6">
							<select class="form-control" name="catId">
							<foreach name="articleCats" item="val" key="key">
									<option value="<{$val['catId']}>"><{$val['count']}><{$val['catName']}></option>
							</foreach>
							</select>
						</div>
					</div>
					<!-- <div class="form-group">
						<label class="col-sm-2 control-label" for="articleImg">文章特色图</label>
						<div class="col-md-6">
							<input type="text" class="form-control" placeholder="articleImg" name="articleImg" id="articleImg"  value="<{$articles.articleImg}>" />
						</div>
					</div> -->

					<div class="form-group">
	                    <label class="col-sm-2 control-label" for="isShow">是否显示</label>
	                    <div class="col-md-6">
	                    <div class="radio-list">
	                      <label class="radio-inline">
	                      <input type="radio" name="isShow" id="optionsRadios1" value="1" <if condition="$articles.isShow eq 1">checked</if>> 是 </label>
	                      <label class="radio-inline">
	                      <input type="radio" name="isShow" id="optionsRadios2" value="0" <if condition="$articles.isShow eq 0">checked</if>> 否 </label>
	                    </div>
	                    </div>
	                  </div>
		
		
					<div class="form-group">
						<label class="col-sm-2 control-label" for="articleKey">文章关键字</label>
						<div class="col-md-6">
							<input type="text" class="form-control" placeholder="文章关键字" name="articleKey" id="articleKey"  value="<{$articles.articleKey}>" />
						</div>
					</div>
		
		
					<div class="form-group last">
						<label class="control-label col-md-2" for="articleContent">内容</label>
						<div class="col-md-7">
							<textarea class="ckeditor form-control"  name="articleContent" id="articleContent"  rows="6"><{$articles.articleContent}></textarea>
						</div>
					</div>

					<div class="form-group fluid">
	                	<div class="col-md-offset-2 col-md-9">
		                  <button type="submit" class="btn blue">保存</button>
		                  <button type="reset" class="btn default">取消</button>
		                </div>
		              </div>  
				</form>
			</div>
		</div>
	</div>
</div>
</block>

